<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
            <h:outputText value="#{mdata_Addnew.message}" escape="false"/>
            <div class="t-title">
                <h3>ADD NEW DATA Example: Song. Movie. Video Game</h3>
                <div class="t-in">
                    <div style="margin: 0 auto; width: 80%">
                        <table width="100%">
                            <tr>
                                <td width="120px">
                                    Cate Disc
                                </td>
                                <td>
                                    <h:selectOneMenu class="commoboxIm" onchange="submit()" 
                                                     value="#{mdata_Addnew.idAlbum}">
                                        <f:selectItems value="#{mdata_Index.listCateAlbum}"/>
                                        <p:ajax Listener="#{mdata_Addnew.cateAlbumValueChange}"/>
                                    </h:selectOneMenu>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Name Data
                                </td>
                                <td>
                                    <h:inputText  class="inputIm" value="#{mdata_Addnew.dataAlbumName}"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Path file
                                </td>
                                <td>
                                    <h:form enctype="multipart/form-data" id="th13">
                                        <h:inputText id="msga2"  class="inputIm" disabled="true" style="background-color: #ECEBEC" 
                                                     value="#{fileUploadController.fileimage}" />
                                        <p:fileUpload fileUploadListener="#{fileUploadController.uploadToData}"
                                                      mode="advance" value="#{fileUploadController.fileimage}"
                                                      update="msga2,messages2"
                                                      label="Choose a file"
                                                      sizeLimit="90485760"
                                                      allowTypes="/(\.|\/)(mp3|mp4|wav|MP3|MP4|WAV)$/"
                                                      invalidSizeMessage="The maximum file size allowed is 1 Megabyte !"
                                                      invalidFileMessage="You are allowed mp3, mp3, wav !"/>
                                        <p:growl id="messages2" showDetail="true" sticky="true"/>
                                    </h:form>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Guest/User
                                </td>
                                <td>
                                    <h:selectOneMenu class="commoboxIm" onchange="submit()"
                                                     value="#{mdata_Addnew.typeGuestUser}">
                                        <f:selectItems value="#{mdata_Addnew.listuserguest}"/>
                                        <p:ajax listener="#{mdata_Addnew.userGuestChange}"/>
                                    </h:selectOneMenu>
                                </td>
                            </tr>
                            <tr>
                                <td>

                                </td>
                                <td align="right">
                                    <h:commandButton value="Save" class="expoler-window" id="btnsavedata" action="#{mdata_Addnew.btnsavedata_Click}"/>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
    </h:body>
</html>

